<?php
/**
 * (jobs)
 */
namespace App\Jobs\Operation;

use App\Logic\Operation\CrawlReviews as LCrawlReviews;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class CrawlReviews implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * 任务最大尝试次数。
     *
     * @var int
     */
    public $tries = 2;

    /**
     * 任务运行的超时时间。
     *
     * @var int
     */
    public $timeout = 600;

    protected $country;

    /**
     * CrawlReviews constructor.
     * @param $country
     */
    public function __construct($country)
    {
        $this->country = $country;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        LCrawlReviews::handle($this->country);
    }
}
